/*
    Copyright (c) 2012-2013 The Ohio State University.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
*/

#ifndef __SSB_INVIJOIN__
#define __SSB_INVIJOIN__

#include "common.h"


struct joinNode{
    int totalAttr;                  /* the toal number of attributes generated by the join */
    int tupleSize;                  /* the size of the tuple in the join result */

    int *attrType;                  /* the type of each output attribute */
    int *attrSize;                  /* the size of each output attribute */

    struct tableNode *factTable;    /* the fact table */
    struct tableNode **dimTable;    /* all the dimension table */

    int dimNum;                     /* the number of dimension tables */

    int *factIndex;                 /* the index of join key for each join in fact table */
    int *dimIndex;                  /* the index of join key for each join in dimensional table */

    int factOutputNum;              /* the number of final output attributes from fact table */
    int *factOutputPos;             /* the final position of each output attribute from fact table */
    int *factOutputIndex;           /* the index of each output attribute from fact table */

    int dimOutputTotal;             /* the total nummber fo final output attributes from all the dimensional tables */
    int *dimOutputPos;              /* the final position of each output attribute from dimension tables */
    int *dimOutputNum;              /* the number of final output attributes from each dimensional table */
    int **dimOutputIndex;           /* the index of each output attribute from dimensional table */

    int * dataPos;
    
    int * keepInGpu;        
};


#endif
